package com.hnkywl.sts.action.htgl;

import com.hnkywl.sts.action.flow.assign.RegectTaskSingleBackWayCmd;
import com.hnkywl.sts.dao.htgl.CghtDao;
import com.hnkywl.sts.entity.djgl.Jydd;
import com.hnkywl.sts.entity.htgl.Cght;
import com.hnkywl.sts.entity.htgl.Htmx;
import com.hnkywl.sts.entity.htgl.Xsht;
import com.hnkywl.sts.entity.organ.Lj;
import com.hnkywl.sts.entity.sys.Bm;
import com.hnkywl.sts.entity.sys.Gncz;
import com.hnkywl.sts.entity.sys.Yg;
import com.hnkywl.sts.service.flow.FlowService;
import com.hnkywl.sts.service.htgl.CghtService;
import com.hnkywl.sts.service.htgl.XshtService;
import com.hnkywl.sts.service.jhgl.HkjhService;
import com.hnkywl.sts.service.organ.LjwhService;
import com.hnkywl.sts.service.sys.GnczService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.util.POIUtil;
import com.hnkywl.sts.util.ReflectionUtils;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.jbpm.api.*;
import org.jbpm.api.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-4-8
 * Time: 下午1:42
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/htgl/xshtgl")
public class XshtglAction extends SimpleActionSupport {
    private XshtService xshtService;

    private CghtService cghtService;

    private HkjhService hkjhService;

    private FlowService flowService;

    private ProcessEngine processEngine;

    private TaskService taskService;

    private ExecutionService executionService;

    private HistoryService historyService;

    private LjwhService ljwhService;
    private CghtDao cghtDao;

    //分页组件 起始位置
    private int page;
    //分页组件 页面大小
    private int rows;
    //类型
    private String xslx;
    //销售合同ID
    private Long xshtId;
    //销售合同ID
    private Long cghtId;

    //当前登录员工的公司ID
    private Long gsId;
    private Long zggsId;
    private Yg yg;
    private String xyType;
    private Xsht xsht;
    //查询条件
    private String zt;
    private Cght cght;
    //合作方Id
    private Long hzfId;
    //所属部门Id
    private Long ssbmId;
    //所属公司Id
    private Long ssgsId;
    //销售人Id
    private Long xsrId;
    //合同编号
    private String htbh;

    private Date startDate;

    private String result;

    private String taskId;

    private String content;

    private String processInstanceId;

    private String executionId;

    private Bm hthm;

    private String xshtHtbm;

    private String xshtEmwtime;

    private Long htdyId;

    //功能操作
    private List<Gncz> gnczList;
    private GnczService gnczService;

    // 付款公式
    private String fkgs;

    private String bindNos;

    private String xsxt_xsdh;
    private String carNo;
    private String bindNo;
    private String weight;
    private String xhtbm;
    private Date currentTime = new Date();
    private Date startTime;
    private Date endDate;


    /**
     * 销售合同查询
     */
    @Action("xshtList")
    public void xshtList() {
        this.renderJson(this.xshtService.findAllXsHt(zt, xslx, htbh, ssgsId, ssbmId, xsrId, hzfId, startDate, endDate, xhtbm, page, rows));
    }

    @Action("xshtgl")
    public String xshtgl() {
        gnczList = gnczService.findGnczByJsAndUrl(request.getServletPath());
        startTime = sDaysAfterNowDate(7);
        return SUCCESS;
    }


    //   当前日期加减n天后的日期，返回String   (yyyy-mm-dd)
    private Date sDaysAfterNowDate(int n) {
        Calendar rightNow = Calendar.getInstance();
        rightNow.add(Calendar.DAY_OF_MONTH, -n);
        return rightNow.getTime();
    }

    @Action("xshtSimpleList")
    public void xshtSimpleList() {
        String khmc = this.request.getParameter("q");
        renderJson(this.xshtService.findAllSimpleXsHt(zt, khmc, page, rows));
    }

    @Action("xshtByProcessInstance")
    public void cghtByProcessInstance() {
        Xsht xsht;
        String processInstanceId = StringUtils.EMPTY;
        Execution execution = this.executionService.findExecutionById(executionId);
        if (execution != null) {
            xsht = this.xshtService.findXshtDetailByProcessInstance(execution.getProcessInstance().getId());
            processInstanceId = execution.getProcessInstance().getId();
        } else {
            xsht = this.xshtService.findXshtDetailByProcessInstance(executionId);
            processInstanceId = executionId;
        }
        String xyJson = "{'id':'" + xsht.getId() + "','type':'XSHT','businessNo':'" + xsht.getHtbm() + "','processInstanceId':'" + processInstanceId + "'}";
        this.renderText(xyJson);
    }


    @Actions({@Action("xshtgl_content"), @Action("xshtgl_detail")})
    public String xshtContent() {
        try {
            gsId = YgService.getCurrentYgGsId();
            zggsId = YgService.getCurrentYgZgGsId();
            yg = YgService.getCurrentYg();
            if (xshtId != null) {
                xsht = this.xshtService.findXshtDetail(xshtId);
                cght = cghtService.findByCghtId(xsht.getZddhcght().getId());
                if (null != xsht.getXy()) {
                    xyType = xsht.getXy().getClass().getSimpleName();
                }
            } else {
                this.startDate = new Date();
            }
            if (null != xsht && null != xsht.getLj()) {
                Lj lj = this.ljwhService.find(xsht.getLj().getId());
                if (null != lj && null != lj.getXshtmb()) {
                    htdyId = lj.getXshtmb().getId();
                    xshtHtbm = xsht.getHtbm();
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
                    xshtEmwtime = simpleDateFormat.format(xsht.getLastUpdated());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return SUCCESS;
    }

//    @Action("createXsht")
//    public void createXsht() {
//        try {
//            Cght cght = this.cghtService.findCghtDetail(cghtId);
//            Xsht xsht = this.xshtService.createXsht(cght);
//            this.hkjhService.createHkjh(xsht);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }


    /**
     * 销售合同明细
     */
    @Action("xshtgl_htmx")
    public void xshtmxDetail() {
        if (rows == 0)
            rows = -1;
        this.renderJson(this.xshtService.findXshtmxDetail(xshtId, page, rows));
    }


    @Action("xshtgl_xsd_xsmx")
    public void xsmxDetail() {
        if (rows == 0)
            rows = -1;
        this.renderJson(this.xshtService.findXshtmxDetailForXsmx(xshtId, page, rows));
    }

    /**
     * 1、根据xshtid找到cghtid
     * 2、根据cghtid找到所有对应的销售单ids
     * 3、根据ids找出所有的卡号信息
     */
    @Action("xshtgl_xsmx")
    public void xshtglXsmx() {
        this.renderJson(this.xshtService.findXsmxFromKh(xsxt_xsdh, carNo, weight, bindNo, null, xshtId, 1, 999999999));
    }

    @Action("xshtgl_xsmx_kbh")
    public void xshtglXsmxkbh() {
        this.renderJson(this.xshtService.findXsmxFromKh(null, null, null, null, bindNos, xshtId, 1, 999999999));
    }

    @Action("xshtgl_htmx_exp")
    public String xshtmxExp() {
        List<Map> htmx = xshtService.findXshtmxDetailList(xshtId);
        //第一步，创建一个webbook，对应一个Excel文件
        HSSFWorkbook wb = new HSSFWorkbook();
        //第二步，在webbook中添加一个sheet,对应Excel文件中的sheet
        HSSFSheet sheet = wb.createSheet("sheet1");
        POIUtil poiUtil = new POIUtil(wb);
        //设置列宽
        sheet.setDefaultRowHeightInPoints(15);
        sheet.setDefaultColumnWidth((short) 15);
        HSSFCellStyle titleStyle = poiUtil.createHeader3HSSFCellStyle(wb);
        poiUtil.fillRow(sheet, titleStyle, 0, "物资编码", "物资名称", "规格型号", "单位", "产地", "数量", "记重方式", "含税单价", "不含税单价", "含税总金额");
        for (int i = 1; i < htmx.size() + 1; i++) {
            Map item = htmx.get(i - 1);
            poiUtil.fillRow(sheet, null, i, item.get("wzgg.code"), item.get("wzgg.name"), item.get("wzgg.ggxh"), item.get("wzgg.dw"),
                    item.get("cd.z"), item.get("sbsl"), item.get("jzfs.z"), item.get("hsj"), item.get("bhsj"), item.get("hsje"));
        }
        try {
            response.setContentType("application/x-download");
            String filedisplay = new String(("销售合同明细.xls").getBytes("gb2312"), "iso8859-1");
            response.addHeader("Content-Disposition", "attachment;filename=" + filedisplay);
            wb.write(response.getOutputStream());
            response.getOutputStream().close();
        } catch (Exception e) {
            e.printStackTrace();
            renderText("位置异常，导出失败" + e.getMessage());
        }
        return null;
    }

    //添加销售合同
    @Action("add_xsht")
    public void addXsht() {
        try {
            initXsht(xsht);
            Xsht xshtTemp = this.xshtService.saveXsht(xsht);
            renderText("{\"statusCode\":\"200\",\"xshtId\":\"" + xshtTemp.getId() + "\", \"message\":\"保存销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    //修改销售合同
    @Action("edit_xsht")
    public void editXsht() {
        try {
            Xsht clone = this.xshtService.findXshtDetail(xsht.getId());
            //xsht.setHtmxList(clone.getHtmxList());
            String htbm = clone.getHtbm();
            ReflectionUtils.getInstance(clone, xsht);
            initXsht(clone);
            this.xshtService.editXsht(clone, htbm);
            renderText("{\"statusCode\":\"200\", \"message\":\"修改销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("fkfsList")
    public void fkfsList() {
        if (xshtId != null) {
            renderJson(cghtService.findFkfsByhtId(xshtId));
        } else {
            renderJson(cghtService.findFkfsByhtId(Long.parseLong("0")));
        }
    }


    //销售合同去null处理
    private void initXsht(Xsht xsht) {
        if (xsht.getHzf() != null && xsht.getHzf().getId() == null) {
            xsht.setHzf(null);
        }
        if (xsht.getGc() != null && xsht.getGc().getId() == null) {
            xsht.setGc(null);
        }
        if (xsht.getFkfs() != null && xsht.getFkfs().getId() == null) {
            xsht.setFkfs(null);
        }
        if (xsht.getFhzr() != null && xsht.getFhzr().getId() == null) {
            xsht.setFhzr(null);
        }
        if (xsht.getXsfy() != null && xsht.getXsfy().getId() == null) {
            xsht.setXsfy(null);
        }
        if (xsht.getHtxz() != null && xsht.getHtxz().getId() == null) {
            xsht.setHtxz(null);
        }
        if (xsht.getWlfgs() != null && xsht.getWlfgs().getId() == null) {
            xsht.setWlfgs(null);
        }
        if (xsht.getWlfbm() != null && xsht.getWlfbm().getId() == null) {
            xsht.setWlfbm(null);
        }
        if (xsht.getWlfry() != null && xsht.getWlfry().getId() == null) {
            xsht.setWlfry(null);
        }
        if (xsht.getHtmxList() != null) {
            for (Htmx htmx : xsht.getHtmxList()) {
                if (htmx.getCd() != null && htmx.getCd().getId() == null) {
                    htmx.setCd(null);
                }
                if (htmx.getJzfs() != null && htmx.getJzfs().getId() == null) {
                    htmx.setJzfs(null);
                }
            }
        }

        xsht.setZt("ybc");
    }

    @Action("transfer_xsht")
    public void transfer_xsht() {
        try {
            this.xshtService.transferXsht(xshtId);
            renderText("{\"statusCode\":\"200\", \"message\":\"同步销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }

    }

    /**
     * 方法名:     提交销售合同
     * 功能描述:      提交销售合同审核
     * 输入参数:    <@param cghtId 销售合同ID>
     * 异常:      <RuntimeException  Exception>
     * 创建人:     lingyun
     * 创建日期:   13-3-7上午11:47
     * 修改人:     lingyun
     * 修改日期:   13-3-7上午11:47
     */
    @Action("commit_xsht")
    public void commitXsht() {
        try {
            xsht = this.xshtService.findXshtDetail(xshtId);
            Cght cght = this.cghtDao.get(xsht.getZddhcght().getId());
            if (cght.getZt().equals("ybc")) {
                throw new RuntimeException("请先提交采购合同!");
            }
            Jydd jydd = cghtService.findJydd(cght.getXsxt_htbm());
            if (null == jydd) {
                if (null == xsht.getGspz() && xsht.getZddhcght().getBzjfs() != 2) {
                    throw new RuntimeException("计算代理费订单必须关联代理费计算公式！再提交");
                }
            } else {
                if (null != jydd.getDingdan_type() && jydd.getDingdan_type().equals("1") && null == xsht.getGspz()) {
                    throw new RuntimeException("计算代理费订单必须关联代理费计算公式！再提交");
                }

            }

            // 判断是居中结算订单，还是不是居中结算订单
            if (null == xsht.getExtension() || cght.getExtension().equals("normal")) {
                if (this.flowService.checkFlowStart("销售合同流程")) {
                    String contain = StringUtils.EMPTY;
                    if (xsht.getCreateDepartment().getId() == 30
                            || xsht.getCreateDepartment().getId() == 26
                            || xsht.getCreateDepartment().getId() == 27
                            || xsht.getCreateDepartment().getId() == 28
                            || xsht.getCreateDepartment().getId() == 29
                            || xsht.getCreateDepartment().getId() == 8131
                            || xsht.getCreateDepartment().getId() == 8132
                            || xsht.getCreateDepartment().getId() == 8133
                            || xsht.getCreateDepartment().getId() == 8134)
                        contain = "协议";
                    else if (xsht.getXy() != null)
                        contain = "协议";
                    String processInstanceId = this.flowService.regTask(xsht.getProcessInstanceId(), "销售合同流程", contain);
                    xsht.setProcessInstanceId(processInstanceId);
                    xsht.setZt("ytj");
                } else
                    xsht.setZt("ysp");
                this.xshtService.editXsht(xsht, xsht.getHtbm());
                renderText("{\"statusCode\":\"200\", \"message\":\"提交销售合同成功\"}");
            } else {
                this.xshtService.tjXsht(xshtId, jydd);
                renderText("{\"statusCode\":\"200\", \"message\":\"提交销售合同成功\"}");
            }
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }


    //删除销售合同
    @Action("delete_xsht")
    public void delete_xsht() {
        try {
            Xsht xsht = this.xshtService.deleteXsht(xshtId);
//            this.flowService.delPorcessInstance(xy.getProcessInstanceId());
            renderText("{\"statusCode\":\"200\", \"message\":\"废除销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    //履约合同
    @Action("agree_xsht")
    public void agree_xsht() {
        try {
            this.xshtService.agreeXsht(xshtId);
            renderText("{\"statusCode\":\"200\", \"message\":\"履约销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }

    @Action("stop_xsht")
    public void stop_xsht() {
        try {
            this.xshtService.stopXsht(xshtId);
            renderText("{\"statusCode\":\"200\", \"message\":\"终止销售合同成功\"}");
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"" + e.getMessage() + "\"}");
        }
    }


    @Action(value = "examineTask")
    public void examineTask() {
        if (this.result.equals("审核")) {
            Map<String, Object> var = new HashMap<String, Object>();
            var.put("owner", YgService.getCurrentYg().getId());
            var.put("opera", YgService.getCurrentYgGs() + "--" + YgService.getCurrentYgName());
            var.put("result", "审核通过");
            var.put("content", content);
            var.put("time", new Date());

            Task currentTask = this.taskService.getTask(taskId);
            String executionId = currentTask.getExecutionId();
            executionService.createVariables(executionId, var, true);

            Execution execution = this.executionService.findExecutionById(executionId);
            Xsht xsht = xshtService.findXshtDetailByProcessInstance(execution.getProcessInstance().getId());
            var.put("status", result);

            if (xsht.getCreateDepartment().getId() == 30
                    || xsht.getCreateDepartment().getId() == 26
                    || xsht.getCreateDepartment().getId() == 27
                    || xsht.getCreateDepartment().getId() == 28
                    || xsht.getCreateDepartment().getId() == 29
                    || xsht.getCreateDepartment().getId() == 8131
                    || xsht.getCreateDepartment().getId() == 8132
                    || xsht.getCreateDepartment().getId() == 8133
                    || xsht.getCreateDepartment().getId() == 8134)
                var.put("contain", "协议");
            else if (xsht.getXy() != null)
                var.put("contain", "协议");
            else
                var.put("contain", StringUtils.EMPTY);
            this.taskService.completeTask(taskId, var);

            if (xsht.getZt().equals("ybc")) {
                xsht.setZt("ytj");
                xshtService.editXsht(xsht, xsht.getHtbm());
            }
        } else {
            String result = processEngine.execute(new RegectTaskSingleBackWayCmd(taskId, content));
            if (result.equals("change")) {
                //修改状态  ytj--->ybc
                String executionId = this.historyService.createHistoryTaskQuery().taskId(taskId).uniqueResult().getExecutionId();
                Execution execution = this.executionService.findExecutionById(executionId);
                Xsht xsht = xshtService.findXshtDetailByProcessInstance(execution.getProcessInstance().getId());
                xsht.setZt("ybc");
                xshtService.editXsht(xsht, xsht.getHtbm());
            }
        }
        this.renderText("{\"statusCode\":\"200\", \"message\":\"审核流程成功\"}");
    }

    /**
     * 校验回款公式输入是否正确
     */
    @Action("checkfkgs")
    public void checkfkgs() {
        try {
            fkgs = fkgs.replace("A", "1");
            String reslut = this.xshtService.checkFkgs(fkgs.replace("%", "/100"));
            if (reslut.equals("0")) {
                renderText("{\"statusCode\":\"200\", \"message\":\"公式输入正确\"}");
            } else {
                renderText("{\"statusCode\":\"300\", \"message\":\"公式输入错误\"}");
            }
        } catch (Exception e) {
            e.printStackTrace();
            renderText("{\"statusCode\":\"300\", \"message\":\"公式输入错误\"}");
        }
    }

    //=================getter setter===============

    public Cght getCght() {
        return cght;
    }

    public void setCght(Cght cght) {
        this.cght = cght;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public String getXslx() {
        return xslx;
    }

    public void setXslx(String xslx) {
        this.xslx = xslx;
    }

    public Long getXshtId() {
        return xshtId;
    }

    public void setXshtId(Long xshtId) {
        this.xshtId = xshtId;
    }

    public Long getCghtId() {
        return cghtId;
    }

    public void setCghtId(Long cghtId) {
        this.cghtId = cghtId;
    }

    public Long getGsId() {
        return gsId;
    }

    public void setGsId(Long gsId) {
        this.gsId = gsId;
    }

    public Yg getYg() {
        return yg;
    }

    public void setYg(Yg yg) {
        this.yg = yg;
    }

    public Xsht getXsht() {
        return xsht;
    }

    public void setXsht(Xsht xsht) {
        this.xsht = xsht;
    }

    public String getZt() {
        return zt;
    }

    public void setZt(String zt) {
        this.zt = zt;
    }

    public Long getHzfId() {
        return hzfId;
    }

    public void setHzfId(Long hzfId) {
        this.hzfId = hzfId;
    }

    public Long getSsbmId() {
        return ssbmId;
    }

    public void setSsbmId(Long ssbmId) {
        this.ssbmId = ssbmId;
    }

    public Long getSsgsId() {
        return ssgsId;
    }

    public void setSsgsId(Long ssgsId) {
        this.ssgsId = ssgsId;
    }

    public Long getXsrId() {
        return xsrId;
    }

    public void setXsrId(Long xsrId) {
        this.xsrId = xsrId;
    }

    public String getHtbh() {
        return htbh;
    }

    public void setHtbh(String htbh) {
        this.htbh = htbh;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Long getZggsId() {
        return zggsId;
    }

    public void setZggsId(Long zggsId) {
        this.zggsId = zggsId;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getExecutionId() {
        return executionId;
    }

    public void setExecutionId(String executionId) {
        this.executionId = executionId;
    }

    public Bm getHthm() {
        return hthm;
    }

    public void setHthm(Bm hthm) {
        this.hthm = hthm;
    }

    public Long getHtdyId() {
        return htdyId;
    }

    public void setHtdyId(Long htdyId) {
        this.htdyId = htdyId;
    }

    public List<Gncz> getGnczList() {
        return gnczList;
    }

    public void setGnczList(List<Gncz> gnczList) {
        this.gnczList = gnczList;
    }

    public String getXyType() {
        return xyType;
    }

    public void setXyType(String xyType) {
        this.xyType = xyType;
    }

    public String getXshtHtbm() {
        return xshtHtbm;
    }

    public void setXshtHtbm(String xshtHtbm) {
        this.xshtHtbm = xshtHtbm;
    }

    public String getXshtEmwtime() {
        return xshtEmwtime;
    }

    public void setXshtEmwtime(String xshtEmwtime) {
        this.xshtEmwtime = xshtEmwtime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFkgs() {
        return fkgs;
    }

    public String getBindNos() {
        return bindNos;
    }

    public void setBindNos(String bindNos) {
        this.bindNos = bindNos;
    }

    public void setFkgs(String fkgs) {
        this.fkgs = fkgs;
    }

    public String getXsxt_xsdh() {
        return xsxt_xsdh;
    }

    public void setXsxt_xsdh(String xsxt_xsdh) {
        this.xsxt_xsdh = xsxt_xsdh;
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public String getBindNo() {
        return bindNo;
    }

    public void setBindNo(String bindNo) {
        this.bindNo = bindNo;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getXhtbm() {
        return xhtbm;
    }

    public void setXhtbm(String xhtbm) {
        this.xhtbm = xhtbm;
    }

    public Date getCurrentTime() {
        return currentTime;
    }

    public void setCurrentTime(Date currentTime) {
        this.currentTime = currentTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Autowired
    public void setHkjhService(HkjhService hkjhService) {
        this.hkjhService = hkjhService;
    }

    @Autowired
    public void setXshtService(XshtService xshtService) {
        this.xshtService = xshtService;
    }

    @Autowired
    public void setCghtService(CghtService cghtService) {
        this.cghtService = cghtService;
    }

    @Autowired
    public void setFlowService(FlowService flowService) {
        this.flowService = flowService;
    }

    @Autowired
    public void setExecutionService(@Qualifier("executionService") ExecutionService executionService) {
        this.executionService = executionService;
    }

    @Autowired
    public void setTaskService(@Qualifier("taskService") TaskService taskService) {
        this.taskService = taskService;
    }

    @Autowired
    public void setProcessEngine(@Qualifier("processEngine") ProcessEngine processEngine) {
        this.processEngine = processEngine;
    }

    @Autowired
    public void setHistoryService(@Qualifier("historyService") HistoryService historyService) {
        this.historyService = historyService;
    }

    @Autowired
    public void setLjwhService(LjwhService ljwhService) {
        this.ljwhService = ljwhService;
    }

    @Autowired
    public void setGnczService(GnczService gnczService) {
        this.gnczService = gnczService;
    }

    @Autowired
    public void setCghtDao(CghtDao cghtDao) {
        this.cghtDao = cghtDao;
    }
}
